package correct.day3;

import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int x = scanner.nextInt();
        int[] a = new int[n];
        for(int i = 0; i < n; i++) {
            a[i] = scanner.nextInt();
        }
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = -1;
        }

        // 10 20
        // 2 7 2 10 3 1 15 9 4 11
        // -1 -1 -1 0 1 1 3 6 6 7
        // 1 4
        for(int i = 0; i < n; i++) {
            int r = i;
            int sum = 0;
            while(r >= 0) {
                sum += a[r];
                if(sum >= x) {
                    arr[i] = r;
                    break;
                }
                r--;
            }
        }

        int min = Integer.MAX_VALUE;
        for(int i = 0; i < n; i++) {
            if(arr[i] != -1) {
                min = Math.min(min, arr[i]);
            }
            System.out.print(arr[i] + " ");
        }
        System.out.println();
        for (int i = 0; i < n; i++) {
            if (arr[i] == min) {
                System.out.printf((arr[i]+1) + " " + (i+1));
            }
        }
    }
}
